<?php
// +----------------------------------------------------------------------
// |
// +----------------------------------------------------------------------
// |
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// |
// +----------------------------------------------------------------------

namespace app\model;

use \think\Model;

class Tutorial extends Model
{
    protected $name = 'tutorial';
    protected $autoWriteTimestamp = false;
    protected $insert = [];
    protected $update = [];

    const TYPES = [1 => '本地视频播放', 2 => '教程图片', 3 => '跳转视频号播放'];

    public function category()
    {
        return $this->belongsTo(TutorialCategory::class, 'category_id')
            ->bind([
                'category_name' => 'name',
            ]);
    }
}
